import { TaskDelayTypeList } from '@/pages/Task/utils';
import InfoModal from '@/pages/Task/components/InfoModal';
import { FILE_RENDER, REASON_RENDER, FORMAT_DATE, MINUTE_TO_WORK_STR } from './renderUtil';
import { fetchOperateDetails } from './util';
// 延期详情弹框 -----
const columns = [
    {
        title: '延期类型',
        dataIndex: 'delayType',
        require: true,
        render: value => {
            const { text } = TaskDelayTypeList.find(item => item.value === value) || {};
            return text;
        }
    },
    {
        title: '原截止时间',
        dataIndex: 'planEndTime',
        render: FORMAT_DATE
    },
    {
        title: '申请新截止时间',
        dataIndex: 'applyPlanEndTime',
        require: true,
        render: FORMAT_DATE
    },
    {
        title: '原预估工时',
        dataIndex: 'estimateWorkDuration',
        render: MINUTE_TO_WORK_STR
    },
    {
        title: '申请新预估工时',
        dataIndex: 'applyEstimateWorkDuration',
        render: MINUTE_TO_WORK_STR
    },
    {
        title: '原因',
        dataIndex: 'operateReason',
        require: true,
        render: REASON_RENDER
    },
    {
        title: '附件',
        dataIndex: 'taskOperateFile',
        render: FILE_RENDER
    }
];
export const showDelayInfoModal = async (id, operateRecordId) => {
    const dataSource = await fetchOperateDetails(id, operateRecordId);
    return InfoModal.showCommonModal({ columns, dataSource, title: '延期详情' });
};
